<template>
	<view class="content" :style="{ height: `calc(100vh - ${statusBarHeight}rpx)` }" >
		<view style="flex: 1; overflow: auto;">
			<shopCart @childPlacOrder="childPlacOrder" ></shopCart>
		</view>
	</view>
</template>

<script>
import shopCart from "@/components/shop-cart/shop-cart.vue";
	export default {
		components: {
            shopCart,
		},
		data() {
			return {
				statusBarHeight: 0,
               
			}
		},
        created() { // 子组件 onLoad 不生效
			this.statusBarHeight = this.$globalMap.statusBarHeight
            console.log('== height shopCart ', this.statusBarHeight)
		},
		methods: {
			childPlacOrder(param) {
				console.log('== param 11 ', param)

				if (!param.totalSl) {
                    uni.showToast({
                        title: '请先勾选商品',
                        icon: 'none'
                    });
                    return
                }

				let data = {
                    // ...this.khInfo,
                    ...param
                }

				uni.navigateTo({
                    // url: `./billing?khInfo=${JSON.stringify(data)}`
                });

				console.log('== data ', data)
			}
          
		}
	}
</script>

<style lang="less" scoped>
.content {
    height: 100vh;
	display: flex;
    flex-direction: column;
    background: #fff;
    font-size: 16rpx;
	.content_center {
       
	}
}
</style>
